package com.tomatozq163.receiver;

import com.tomatozq163.dto.NotificationDTO;
import org.springframework.stereotype.Component;

@Component
public class DeviceReceiver {
    public void handleMessage(String message){
        try {
//            System.out.println(new String(message, "UTF-8"));
            System.out.println(message);
        }
        catch (Exception ex){
            ex.getMessage();
        }
    }

    public void handleMessage(NotificationDTO dto){
        try {
//            System.out.println(new String(message, "UTF-8"));
            System.out.println(dto.getDeviceNo() + "," + dto.getMessage());
        }
        catch (Exception ex){
            ex.getMessage();
        }
    }
}
